from login01 import LoginApi
from kkl_class import Class as KklClass  # 重命名避免冲突
from kkl_order import Order


def login():
    login_api = LoginApi()
    login_api.loginMobile()
    login_api.xhxLogin()
    return login_api


def get_class_id(course_id,teacher_id):
    try:
      KklClass().getClassid(course_id,teacher_id)
    except Exception as e:
        print(f"获取课程ID失败: {e}")
        return None


def import_order(start_num, count, product_id):
    try:
        Order().importOrder(start_num, count, product_id)
        print("订单导入成功")
    except Exception as e:
        print(f"订单导入失败: {e}")


def main():
    # 登录
    login()

    # 获取课程ID
    get_class_id(105205, 3367)

    # 导入订单
    import_order(17000000005, 2, 90003524)


if __name__ == "__main__":
    main()